﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EvoSim.Simulation.Genes
{
	public abstract class Gene : IDObject, ICloneable, IGeneInfoHolder
	{
		public bool IsMutable = true;

		public Gene(string name)
			: base(name)
		{
		}
		public Gene(string name, string id)
			: base(name, id)
		{
		}

		public void TryToMutate(double mutationChance)
		{
			if (IsMutable)
				Mutate(mutationChance);
		}

		public abstract void Mutate(double mutationChance);

		public abstract Gene Clone();

		object ICloneable.Clone()
		{
			return Clone();
		}

		public abstract GeneInfo GetGeneInfo();
	}
}
